package com.lzb.musicplayer;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.lzb.basic.utils.StatusBarUtils;

public class SplashActivity extends AppCompatActivity {

    private static final long SPLASH_DELAY = 1500; // 1.5 秒

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_splash);
        StatusBarUtils.with(this).init();
        StatusBarUtils.setStatusBarTranslate(this);
        //设置状态栏字体颜色
        StatusBarUtils.setSystemStatusTextColor(false, this);

        // 延时跳转
        new Handler(Looper.getMainLooper()).postDelayed(() -> {
            startActivity(new Intent(SplashActivity.this, HomeActivity.class));
            finish(); // 防止返回键回到 Splash
        }, SPLASH_DELAY);
    }
}